home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / acpi / suspend.d / 30-proc-sysfs-save-state.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2008-10-14  |  698b  |  25 lines

  1. #!/bin/sh
  2. # Paul Sladen 2007-03-22
  3. # Save the state of various things that the kernel does not, or cannot
  4. # maintain over the course of a suspend/resume or suspend/hibernate
  5. # cycle.  Lines are written into '/var/run/proc-sysfs-save-state' in
  6. # the format:
  7. # /sys/foo/bar/moo = XYZ
  8.  
  9. if [ -d /var/run -a -w /var/run ] ; then
  10.     ( 
  11.     for i in /sys/class/net/*/device/rf_kill /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ; do
  12.         if [ -r "$i" ] ; then
  13.         echo -n "$i = " ; cat "$i"
  14.         fi
  15.     done
  16.  
  17.     i=/proc/acpi/ibm/bluetooth
  18.     if [ -r $i ] ; then
  19.         echo -n "$i = "
  20.         grep -q disabled /proc/acpi/ibm/bluetooth && echo disable || echo enable
  21.     fi
  22.     ) > /var/run/proc-sysfs-save-state
  23. fi
  24.  
  25.